package com.shopmall.service;

import com.shopmall.mapper.GoodsMapper;
import com.shopmall.pojo.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class GoodsServiceImpl implements GoodsService{
    @Autowired
    GoodsMapper goodsMapper;

    @Override
    public List<Goods> queryGoodsList(){
        return  goodsMapper.queryGoodsList();
    }

    @Override
    public Goods queryGoodsById(int id){
        return goodsMapper.queryGoodsById(id);
    }

    @Override
    public List<Goods> queryGoodsByName(String name){
        return goodsMapper.queryGoodsByName(name);
    }

    @Override
    public List<Goods> queryGoodsByBrand(String brand) {
        return goodsMapper.queryGoodsByBrand(brand);
    }

    @Override
    public int addGoods(Goods goods){
        return goodsMapper.addGoods(goods);
    }

    @Override
    public int updateGoods(Goods goods){
        return goodsMapper.updateGoods(goods);
    }

    @Override
    public int deleteGoods(int id){
        return goodsMapper.deleteGoods(id);
    }

    @Override
    public int goodsIn(Goods goods){
        return goodsMapper.goodsIn(goods);
    }

    @Override
    public int goodsPic(Goods goods) {
        return goodsMapper.goodsPic(goods);
    }
}
